package com.twohand.admin.Entity;

import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.twohand.admin.Config.ArrayTypeHandler;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@ApiModel("订单表")
@TableName(value = "`order`",autoResultMap = true)
@Data
public class Order extends BaseEntity{
    @ApiModelProperty(name = "订单id")
    String orderId = "";
    @ApiModelProperty(name = "订单号")
    String orderNo;

    @ApiModelProperty(name = "每单结算金额")
    Float money;
    @ApiModelProperty(name = "微信昵称")
    String nickname;
    @ApiModelProperty(name = "手机尾号")
    String phone;
    @ApiModelProperty(name = "实付金额")
    Float amount;
    @ApiModelProperty(name = "订单图片")
    @TableField(typeHandler = ArrayTypeHandler.class)
    JSONArray imgList;
    @ApiModelProperty(name = "订单创建时间")
    String orderCreateTime;
    @ApiModelProperty(name = "账单编号")
    String bid;
    @ApiModelProperty(name = "是否拉黑")
    Integer isBlock;
    @TableField(exist = false)
    String imgStr;
    /*三方订单导入用到的字段*/
    @TableField(exist = false)
    String shopName;
    @TableField(exist = false)
    Integer platform;
    @TableField(exist = false)
    String activeDate;
    String getImgStr(){
        return JSONArray.toJSONString(this.imgList);
    }
}
